import { Controller, Post,Body } from '@nestjs/common';
import { AuthService } from './auth.service';
import { RegisterDto } from 'src/dto/register.dto';
import { LoginrDto } from '@/dto/login.dto';

@Controller()
export class AuthController {
    constructor(private readonly auth:AuthService){
    }

    // 注册
    @Post('register')
    register(@Body() body:RegisterDto){
        return this.auth.register(body)
    }

    // 登录
    @Post('login')
    login(@Body() dto:LoginrDto){
        return this.auth.login(dto)
    }
}
